package controller;

import java.util.ArrayList;
import java.util.Scanner;

public class controller {

	private String _nameListPath;
	private int _academicYear;
	private String _semester;
	private String[] _roomArray;
	private String _schedulingMode;
	
	//convert ArrayList<String> to String []
	private void convert(ArrayList<String> arrary_list_roomNum){
		this._roomArray = new String[arrary_list_roomNum.size()];
		_roomArray = arrary_list_roomNum.toArray(_roomArray);
	}
	
	public controller(String Path, int Year, String semester, ArrayList<String> roomNum, String Mode){
		this._nameListPath = Path;
		this._academicYear = Year;
		this._semester = semester;
		this.convert(roomNum);
		this._schedulingMode = Mode;
	}

	public int get_academicYear() {
		return _academicYear;
	}

	public String get_nameListPath() {
		return _nameListPath;
	}

	public String get_semester() {
		return _semester;
	}

	public String get_schedulingMode() {
		return _schedulingMode;
	}
	
	public String getRoomNumbers(){
		System.out.println("Input the Room Numbers");
		Scanner Keyboard_input = new Scanner( System.in );
		int RoomNum = Keyboard_input.nextInt();
		
		for (int i=0; i<RoomNum; i++){
			if(this._roomArray[i] == Integer.toString(RoomNum))
				return this._roomArray[i];
		}
		
		System.out.println("not such a room");
		return "not such a room";
	}
}
